import { Component } from "vue";
import { Module } from "./types/package";

const modules: Record<string, Module> = import.meta.glob("./elements-vue/*.vue", {
  eager: true,
});
const components: Record<string, Component> = {};

Object.entries(modules).forEach(([key, module]) => {
  const name = key.replace(/\.\/elements-vue\/(.*)\.(tsx|vue)/, "$1");
  components[name] = module?.default || module;
});

console.log(components, "base-widgets");
export default components;
